package com.skyon.rule.res.spring;

import java.util.Map;

import org.drools.runtime.StatefulKnowledgeSession;
import org.drools.runtime.StatelessKnowledgeSession;

import com.skyon.rule.res.exceptions.PlotBuilderException;

/**
 * 对Kbase对外接口操作进行定义
 * 
 * @author cfans
 *
 */
public interface LocalSessionFactory {
	/**
	 * 得到Stateless Session，并对外提供LocalSession
	 * @param id
	 * @return
	 * @throws PlotBuilderException 
	 */
	StatelessKnowledgeSession getLocalStatelessSession(String id) throws PlotBuilderException;
	/**
	 * 得到 StatefulSession，并对外提供LocalSession
	 * @param id
	 * @return
	 * @throws PlotBuilderException 
	 */
	StatefulKnowledgeSession getLocalStatefulSession(String id) throws PlotBuilderException;
	/**
	 * 提供查询指定 root 策略是否存在
	 * @param root
	 * @return
	 */
	public boolean isPlotExist(String root);
	
	/**
	 * 获取指定 id的策略包所需的运行期Class
	 * @param id
	 * @return
	 * @throws PlotBuilderException
	 */
	Map<String, Class<?>> getRutimeClasses(String id) throws PlotBuilderException;
}
